﻿using System;
using System.Collections.Generic;
using System.Windows.Forms;
using System.Text;

namespace PoolSide
{
    public class WorkerInfo
    {
        #region Private Member Variables
        private bool _Alive;
        private decimal _Hashrate;
        private decimal _Score;
        private int _Shares;
        private string _Name;
        #endregion

        #region Properties
        public bool Alive
        {
            get { return _Alive; }
            set { _Alive = value; }
        }
        public decimal Hashrate
        {
            get { return _Hashrate; }
            set { _Hashrate = value; }
        }
        public decimal Score
        {
            get { return _Score; }
            set { _Score = value; }
        }
        public int Shares
        {
            get { return _Shares; }
            set { _Shares = value; }
        }
        public string Name
        {
            get { return _Name; }
            set { _Name = value; }
        }
        #endregion

        #region Methods
        public ListViewItem ToListViewItem()
        {
            ListViewItem lvItem = new ListViewItem();
            lvItem.Tag = this;
            lvItem.Text = _Name;
            lvItem.SubItems.Add(_Shares.ToString());
            lvItem.SubItems.Add(_Score.ToString());
            lvItem.SubItems.Add(_Hashrate.ToString());
            lvItem.SubItems.Add(_Alive ? "Yes" : "No");
            if (!_Alive)
            {
                lvItem.BackColor = System.Drawing.Color.Crimson;
                lvItem.ForeColor = System.Drawing.Color.White;
            }
            return lvItem;
        }
        #endregion

        #region Constructors

        #endregion

    }
}
